home *** CD-ROM | disk | FTP | other *** search
/ NeXTSTEP 3.3 (Developer)…68k, x86, SPARC, PA-RISC] / NeXTSTEP 3.3 Dev Intel.iso / usr / sybase / doc / dbnumrets.man < prev    next >
Text File  |  1993-04-22  |  4KB  |  111 lines

  1.  
  2.   1                       Version 4.0 -- 5/1/89                dbnumrets
  3.   ______________________________________________________________________
  4.  
  5.   NAME:  dbnumrets
  6.  
  7.   FUNCTION:
  8.        Determine the number of return parameter values  generated  by  a
  9.        stored procedure.
  10.  
  11.   SYNTAX:
  12.        int dbnumrets(dbproc)
  13.  
  14.        DBPROCESS *dbproc;
  15.  
  16.   COMMENTS:
  17.  
  18.  
  19.  
  20.  
  21.  
  22.  
  23.  
  24.   dbnumrets               Version 4.0 -- 5/1/89                        2
  25.   ______________________________________________________________________
  26.  
  27.        o dbnumrets() provides the  number  of  return  parameter  values
  28.          returned  by  the  most recent EXECUTE statement or remote pro-
  29.          cedure call on a stored procedure.
  30.        o Transact-SQL stored procedures can return values for  specified
  31.          "return  parameters."  Changes  made  to  the value of a return
  32.          parameter inside the stored procedure are then available to the
  33.          program  that  called  the procedure.  This is analogous to the
  34.          "pass by reference"  facility  available  in  some  programming
  35.          languages.
  36.  
  37.          For a parameter to function as a return parameter, it  must  be
  38.          declared  as  such  within  the  stored procedure.  The EXECUTE
  39.          statement or remote procedure call that calls the  stored  pro-
  40.          cedure must also indicate that the parameter should function as
  41.          a return parameter.  In the case of a remote procedure call, it
  42.          is  the dbrpcparam() routine that specifies whether a parameter
  43.          is a return parameter.
  44.  
  45.  
  46.   3                       Version 4.0 -- 5/1/89                dbnumrets
  47.   ______________________________________________________________________
  48.  
  49.        o When executing a  stored  procedure,  the  server  returns  any
  50.          parameter values immediately after returning all other results.
  51.          Therefore, the application can call dbnumrets() only after pro-
  52.          cessing  the stored procedure's results by calling dbresults(),
  53.          as well as dbnextrow() if appropriate.   (Note  that  a  stored
  54.          procedure  can  generate  several  sets of results-one for each
  55.          SELECT  it  contains.   Before   the   application   can   call
  56.          dbnumrets()  or  any other routines that process return parame-
  57.          ters, it must call dbresults() and dbnextrow() as many times as
  58.          necessary to process all the results.)
  59.        o If the stored procedure is  invoked  with  a  remote  procedure
  60.          call,  the  return parameter values are automatically available
  61.          to the application.  If, on the other  hand,  the  stored  pro-
  62.          cedure is invoked with an EXECUTE statement, the return parame-
  63.          ter values are available only if the command  batch  containing
  64.          the  EXECUTE statement uses local variables, not constants, for
  65.  
  66.  
  67.  
  68.   dbnumrets               Version 4.0 -- 5/1/89                        4
  69.   ______________________________________________________________________
  70.          the return parameters.
  71.  
  72.        o Other  routines  return  additional  information  about  return
  73.          parameter values:
  74.           o dbretdata() returns a pointer to a parameter value.
  75.  
  76.           o dbretlen() returns the length of a parameter value.
  77.           o dbretname() returns the name of a parameter value.
  78.  
  79.           o dbrettype() returns the datatype of a parameter value.
  80.        o For an example of this routine, see Example 8 in the DB-Library
  81.          Reference Supplement.
  82.  
  83.   PARAMETERS:
  84.        dbproc -  A pointer to the DBPROCESS structure that provides  the
  85.            connection for a particular front-end/SQL Server process.  It
  86.            contains all the information that DB-Library uses  to  manage
  87.  
  88.  
  89.  
  90.   5                       Version 4.0 -- 5/1/89                dbnumrets
  91.   ______________________________________________________________________
  92.            communications and data between the front end and SQL Server.
  93.  
  94.   RETURNS:
  95.        The number of return parameter values associated  with  the  most
  96.        recently-executed stored procedure.
  97.  
  98.   SEE ALSO:
  99.        dbnextrow, dbresults, dbretdata, dbretlen, dbretname,  dbrettype,
  100.        dbrpcinit, dbrpcparam
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.